#ifndef REGISTERFUNCTIONALITY_H
#define REGISTERFUNCTIONALITY_H

#include "Modules/ModuleInterface.h"
#include "functionalityInterface.h"

#include "Modules/NetWorkInterface.h"

class registerFunctionality : public FunctionalityInterface
{
    Q_OBJECT
public:
    registerFunctionality(std::shared_ptr<NetworkInterface> network,
                          std::shared_ptr<ModuleInterface> module);

    bool executeFunction() override;
    void setParameters(const QString &phoneNumber, const QString &passwd);

protected slots:
    void onDataArrival(qint64 readBytes);

signals:
    void registraSuccessed(QString data);
    void registraFailed(QString data);

private:
    bool isRegistrationSuccessful(const QString &data);

private:
    std::shared_ptr<NetworkInterface> m_network;
    std::shared_ptr<ModuleInterface> m_module;
};

#endif // REGISTERFUNCTIONALITY_H
